<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 400px;
            height: 400px;
            background-color: #838383;
        }
    </style>
</head>

<body>
    <div></div>
</body>
<script>
    const a = document.querySelector('div')
    let i = 0

    function dianj() {
        a.innerHTML = i++
    }

    function fen(fn, t) {
        let timer

        return function () {
            if (timer) clearTimeout(timer)
            timer = setTimeout(function () {

                fn()
            }, t)
        }
    }


    a.addEventListener('click', fen(dianj, 1000))
</script>

</html>